from django.db import models
from utils.BaseModel import BaseModel
# Create your models here.


class User(BaseModel):
    username = models.CharField(max_length=100, verbose_name='账号')
    password = models.CharField(max_length=30)
    phone = models.CharField(max_length=11, unique=True, verbose_name='手机号')
    email = models.EmailField(unique=True)
    headimg = models.CharField(max_length=100, null=True, blank=True, verbose_name='头像')
    score = models.IntegerField(default=100, verbose_name='积分')
    level = models.IntegerField(choices=((0, '普通会员'), (1, '铂金会员'), (2, '黄金会员')), default=0)
    intro = models.CharField(max_length=100, verbose_name='简介', default='')

    class Meta:
        db_table = 'fguser'

    def __str__(self):
        return self.username

